<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<HTML>


<!-- Mirrored from bos.asmhackers.net/docs/timer/docs/CMOS_C.html by HTTrack Website Copier/3.x [XR&CO'2013], Tue, 07 Oct 2014 11:24:20 GMT -->
<HEAD>

<title>CodePedia -&gt; CMOS_C</title>

<meta name="description" content="CodePedia - the online encyclopedia for developers by developers!  CodePedia makes it easy for you to find what you need, as well as allowing anyone to add new pages and modify existing ones to create the ultimate online development resource.">

<meta name="keywords" content="visual basic, sourcecode, code, download, source, delphi, vb, programming, applet, windows, java, jsp, javascript, asp, database, sql, c, c++, cgi, components, 3d, perl, php, developer, xml, compiler">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<meta name="rating" content="general">

<meta NAME="Robots" CONTENT="all">

<meta name="author" content="Synchron Data">

<meta name="MSSmartTagsPreventParsing" content="TRUE">

<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true for "http://www.programmersheaven.com" r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true for "http://www.programmersheaven.com" r (n 0 s 0 v 0 l 0))'>

<meta name="SecurityCheck" content="#0723409  -  Level 0 - No offensive, abusive, or illegal materials  -  Valid until 02-02-02 ">

<style type="text/css">

<!-- .sourcecode {

	PADDING-RIGHT: 5pt; PADDING-LEFT: 5pt; PADDING-BOTTOM: 5pt; FONT: 9pt "Courier New", 

	Courier, mono; WIDTH: 100%; PADDING-TOP: 5pt; WHITE-SPACE: pre; BACKGROUND-COLOR: #efefff

}	



-->

</style>

</HEAD>

<body bgcolor="#ffffff"> 



<table width="781" border="0" cellspacing="0" cellpadding="0" align="center">



<!-- 728x90 header -->

<tr><td valign="top" width="781" bgcolor="#ffffff" height="33">

<div align="center">

<a href="http://bos.asmhackers.net/"><img height="40" alt="Codepedia - The software and hardware developers Encyclopedia" src="../../../images/codepedia/codepediathin.html" width=781 border=0></a></div>

</td></tr>

<tr><td valign="top" width="781" bgcolor="#000000" height="33">

<table width="100%" border="0" cellspacing="1" cellpadding="0">

<tr><td bgcolor="#000000">

<div align="center">

<!-- Bravenet 728x90 -->

<div align="center"><script language="javascript" TYPE="text/javascript" src="http://www.bravenet.com/jsbanner.php?size=800"></script></div>

</div></td><td>

<a href="http://bos.asmhackers.net/aspnet/common/webcounter.aspx"><img border="0" alt="" src="../../../images/spacer.html" width="1" height="1"></a>

</td></tr></table></td></tr>

<!-- 728x90 header end -->





</table>





<table cellSpacing=0 cellPadding=5 width=780 align=center border=0>

  <tr>

<td width="125" valign="top"><br>

	<form action="http://bos.asmhackers.net/c/login/login.asp" method="post">

		<table height="10" cellSpacing="0" cellPadding="0" width="125" align="center" border="0">

			<tr>

				<td vAlign="top" align="left" width="10"><IMG height="10" alt="" src="../../../images/corner_1.html" width="10"></td>

				<td vAlign="top"><IMG height="10" alt="" src="../../../images/line1.html" width="105"></td>

				<td vAlign="top" align="right" width="10"><IMG height="10" alt="" src="../../../images/corner_2.html" width="10"></td>

			</tr>

		</table>

		<table cellSpacing="0" cellPadding="0" width="125" align="center" bgColor="#000000" border="0">

			<tr align="middle">

				<td>

					<center>

						<table cellSpacing="0" cellPadding="5" width="123" bgColor="#dfdfff" border="0">

							<tr>

								<td>

									<!-- Not logged in box start -->

<img src="../../../images/Rub_Members.html" width="113" height="22" alt="Members"><br>

<font face="Verdana, Arial, Helvetica, sans-serif" size="1">

<b>Username:</b><br>

<input type="hidden" name="thisURL" value="/wiki/display.aspx?WikiID=1&amp;p=CMOS_C">

<input type="text" name="username" size="12" maxlength="99">

<br>

<b>Password:</b><br>

<input type="password" name="password" size="12" maxlength="32"><br>

<input type="checkbox" name="autologin" value="on">

<a href="http://bos.asmhackers.net/c/login/auto_login_info.htm"><b>Auto-login</b></a><br>

<input type="image" width="45" height="18" name="Login" src="../../../images/loginbutton.html" border="0" alt="Login">

<br>

<b><a href="http://bos.asmhackers.net/c/login/register_agreement.asp">Register</a><br>

<a href="http://bos.asmhackers.net/c/login/registerwhy.htm">Why register?</a><br>

<a href="http://bos.asmhackers.net/c/login/forgot_pwd_form.htm">Forgot Password?</a>

</b>

</font>

<!-- Not logged in box end -->

								</td>

							</tr>

						</table>

					</center>

				</td>

			</tr>

		</table>

		<table height="10" cellSpacing="0" cellPadding="0" width="125" align="center" border="0">

			<tr>

				<td vAlign="top" align="left" width="10"><IMG height="10" alt="" src="../../../images/corner_3.html" width="10"></td>

				<td vAlign="top"><IMG height="10" alt="" src="../../../images/line2.html" width="105"></td>

				<td vAlign="top" align="right" width="10"><IMG height="10" alt="" src="../../../images/corner_4.html" width="10"></td>

			</tr>

		</table>

		</form>

	<!-- Second box -->

	<form action="http://bos.asmhackers.net/1/special:searchresult" method="post">

		<table height="10" cellSpacing="0" cellPadding="0" width="125" align="center" border="0">

			<tr>

				<td vAlign="top" align="left" width="10"><IMG height="10" alt="" src="../../../images/corner_1.html" width="10"></td>

				<td vAlign="top"><IMG height="10" alt="" src="../../../images/line1.html" width="105"></td>

				<td vAlign="top" align="right" width="10"><IMG height="10" alt="" src="../../../images/corner_2.html" width="10"></td>

			</tr>

		</table>

		<table cellSpacing="0" cellPadding="0" width="125" align="center" border="0">

			<tr align="middle" bgColor="#000000">

				<td>

					<center>

						<table cellSpacing="0" cellPadding="5" width="123" border="0">

							<tr bgColor="#dfdfff">

								<td noWrap><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>



<A href="http://bos.asmhackers.net/1/special%3ahelp">Help</A><br>

<A href="http://bos.asmhackers.net/1/CP+FAQ">FAQ</A><br>

<A href="http://bos.asmhackers.net/1/special%3aUndefinedPages">Undefined Pages</A><br>

<A href="http://bos.asmhackers.net/1/special%3aOrphanPages">Orphan Pages</A><br>

<A href="http://bos.asmhackers.net/1/special%3aNewPages">Latest Pages</A><br>

<A href="http://bos.asmhackers.net/1/special%3aNotifications">Notifications</A><br>

<A href="http://bos.asmhackers.net/1/special%3aTopUsers">Top Users</A><br>

<br>

<A href="http://www.programmersheaven.com/c/MsgBoard/grouplist.asp">Message Boards</A><br>

<A href="http://www.programmersheaven.com/other/submission.htm">Submit content</A><br>

<a href="http://programmersheaven.tradepub.com/" target="_blank">Free Magazines</a><img alt="" width="24" height="11" src="../../../images/new.html"><br>

<A href="http://bos.asmhackers.net/1/special%3aContact">Contact Us</A><br>

<A href="http://www.programmersheaven.com/other/linktous.htm">Link To Us</A><br>

<a href="http://www.programmersheaven.com/2/PHHelp">Help</a><br>





<br>

<br>

										</b><input type="text" size="10" value="" name="SearchTxt">

										<br>

										<input type="image" height="18" alt="Search the site" width="45" src="../../../images/searchbutton.html" border="0" name="Search">

										<br>

										<b><A href="http://bos.asmhackers.net/1/special%3asearch">Advanced Search</A> </b></font>

								</td>

							</tr>

						</table>

					</center>

				</td>

			</tr>

		</table>

		<table height="10" cellSpacing="0" cellPadding="0" width="125" align="center" border="0">

			<tr>

				<td vAlign="top" align="left" width="10"><IMG height="10" alt="" src="../../../images/corner_3.html" width="10"></td>

				<td vAlign="top"><IMG height="10" alt="" src="../../../images/line2.html" width="105"></td>

				<td vAlign="top" align="right" width="10"><IMG height="10" alt="" src="../../../images/corner_4.html" width="10"></td>

			</tr>

		</table>

	</form>

	<!-- Left column banner -->

	

	<form action="http://bos.asmhackers.net/app/newsletter/newsletter.aspx" method="post">

		<table height="10" cellSpacing="0" cellPadding="0" width="125" align="center" border="0">

			<tr>

				<td vAlign="top" align="left" width="10"><IMG height="10" alt="" src="../../../images/corner_1.html" width="10"></td>

				<td vAlign="top"><IMG height="10" alt="" src="../../../images/line1.html" width="105"></td>

				<td vAlign="top" align="right" width="10"><IMG height="10" alt="" src="../../../images/corner_2.html" width="10"></td>

			</tr>

		</table>

		<table cellSpacing="0" cellPadding="0" width="125" align="center" bgColor="#000000" border="0">

			<tr align="middle">

				<td>

					<center>

						<table cellSpacing="0" cellPadding="5" width="123" bgColor="#dfdfff" border="0">

							<tr>

								<td><IMG height="22" alt="Newsletter" src="../../../images/Rub_Newsletter.html" width="113"><br>

									<font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>E-mail:</b><br>

										<input type="text" size="11" name="theEmail">

										<br>

										<input type="image" height="18" alt="Subscribe to our Newsletter" width="55" src="../../../images/subscribebutton.html" border="0" name="Subscribe">

										<br>

										<A href="http://bos.asmhackers.net/app/newsletter/newsletter.aspx"><b>More information</b></A></font></td>

							</tr>

						</table>

					</center>

				</td>

			</tr>

		</table>

		<table height="10" cellSpacing="0" cellPadding="0" width="125" align="center" border="0">

			<tr>

				<td vAlign="top" align="left" width="10"><IMG height="10" alt="" src="../../../images/corner_3.html" width="10"></td>

				<td vAlign="top"><IMG height="10" alt="" src="../../../images/line2.html" width="105"></td>

				<td vAlign="top" align="right" width="10"><IMG height="10" alt="" src="../../../images/corner_4.html" width="10"></td>

			</tr>

		</table>



<br>



	</form>

</td>



    <td valign="top" width="650"><br>

<table width="630" border="0">

<tr>

<td valign="top"><font face="Arial, Helvetica, sans-serif" size=2>
[<a href="http://bos.asmhackers.net/1/startpage">Home</a>]&nbsp;
[<a href="http://bos.asmhackers.net/wiki/edit.aspx?WikiID=1&amp;pagename=CMOS_C">Edit this page</a>]&nbsp;
[<a href="http://bos.asmhackers.net/1/special%3aRecentChanges&amp;filter=3&amp;days=7">Recent Changes</a>]&nbsp;
[<a href="http://bos.asmhackers.net/1/special%3aSpecialPages">Special Pages</a>]&nbsp;
[<a href="http://bos.asmhackers.net/1/special%3ahelp">Help</a>]&nbsp;
</font>
</td>

</tr></table>



<font face="Verdana, Arial, Helvetica, sans-serif" size="2">			






<hr><font face="Verdana, Arial, Helvetica, sans-serif" size="1">CMOS_C</font>
<hr>

<font size="3"><b>CMOS</b></font><br>

(A little Mystery)

<p>
This article features CMOS, which is an interesting topic for the beginners and for virtually every programmer as CMOS stores the system settings even when you switch off the computer. Ever wondered how Operating system is able to tell you correct time and date even if you keep your computer off for months? All the required settings about FDD, HDD, timers, etc. are stored in a small capacity low powered memory called the CMOS.

<p>
In this article I present you with a basic knowledge of this memory area of your system, how to actually access this memory, a code segment in C and then a memory map of CMOS.

<p>
The CMOS (Complementary Metal Oxide Semiconductor) memory is 65 or 128 byte RAM which is powered by a battery on the motherboard.

<p>
The CMOS is actually out of range of normal address range and cannot be directly reached. It is accessed through IN and OUT commands which are used at ports 70h and 71h.

<p>
Because of the construction of the port 70, the CMOS RAM has an upper limit of 128 bytes. This is because only 7 bits i.e. bits 0-6 are used for addressing and the last bit i.e. bit 7 is used for Enabling or Disabling Non Maskable Interrupts (NMI), bit 7=0 Enable NMI, bit 7=1 Disable NMI

<p>
To access CMOS RAM, the index address (0 to 7F H) is output to port 70H, and the data is then read or written at port 71 H. Interrupts should be inhibited while the entire port 70 H /71 H sequence is completed. Alternatively, the port sequence can occur during an interrupt service routine before re-enabling interrupts. If these precautions are not observed, an interrupt service routine could potentially intervene between the output to port 70 H and the subsequent I/O to port 71 H, overwriting the port 70 H value.

<p>
<b>/*Code segment in C for accessing CMOS*/</b>

<p>
In the following function ReadFromCMOS we execute a loop for 128 times to read all the CMOS locations, each time we clear accumulator, disable interrupts, copy index of the byte to be read to lower byte of accumulator, provide index to port number 70h and then wait for the response to be provided on port 71h, we then copy value provided at port 71h and enable interrupts, this value is then stored in array.

<p>
<pre class="sourcecode">

ReadFromCMOS (unsigned char array [])

{

   int index;

   unsigned char tvalue, bindex;

<p>
   for(index = 0; index &lt; 128; index++)

   {

      char AL_ = (unsigned char) index;

      _asm 

      {

         xor ax,ax       /* Clear accumulator*/

         cli             /* Disable interrupts*/

         mov al,AL_      /* Move index address*/

         out 0x70,al     /* Copy address to CMOS register*/

         nop

         nop

         nop             /* Wait a bit for response*/

         in al,0x71      /* Fetch 1 byte to al*/

         sti             /* Enable interrupts*/

         mov tvalue,al

       }

<p>
       array[index] = tvalue;

   }

}

</pre>

<p>
In the following function WriteToCMOS we execute a loop for 128 times to write to all the CMOS locations, each time we take a byte from array. we clear accumulator, disable interrupts, copy index of the byte to be written to lower byte of accumulator, byte to be written to higher byte of accumulator, provide index to port number 70h and byte to be written on port 71h, we then enable interrupts.

<p>
<pre class="sourcecode">

WriteTOCMOS(unsigned char array[])

{

   unsigned char index;

<p>
   for(index = 0; index &lt; 128; index++)

   {

      unsigned char tvalue = array[index];

      _asm 

      {

         xor ax,ax       /* zero register*/

         cli             /* Clear interrupts*/

         mov al,index    /* move index address*/

         mov ah,tvalue   /* copy value to ah*/

         out 0x70,al     /* copy address to CMOS register*/

         nop

         nop

         nop             /* Wait a bit */

         mov al,ah       /* move value to al*/

         out 0x71,al     /* write 1 byte to CMOS*/

         sti             /* Enable interrupts*/

      }

   }

}

</pre>

<p>
On <a href="http://bos.asmhackers.net/1/Linux">Linux</a>, you must set the IO permission level (iopl) to read or write from those ports.

Sample code for Linux:

<p>
<pre class="sourcecode">

/* (c) 2003 Ark Linux (<a href="http://www.arklinux.org/" target="_blank" title="External Link">http://www.arklinux.org/</a>),

   released to the public domain */

#include &lt;sys/io.h&gt;

inline void cli() {

	asm("cli");

}

inline void sti() {

	asm("sti");

}

void setCmos(int reg, int value)

{

	outb_p(reg, 0x70);

	outb_p(value, 0x71);

}

int readCmos(int reg)

{

	outb_p(reg, 0x70);

	return inb_p(0x71);

}

int main(int argc, char **argv)

{

	iopl(3);

	cli();

	/* Use readCmos() and writeCmos() here */

	sti();

	iopl(0);

}

</pre>

<p>
Below is a typical CMOS RAM memory map for an AT PC. Under a 128 byte ISA compatible CMOS, 16 bytes (00h-0fh) is the real time clock, 32 bytes (10h-2Fh) is the ISA configuration data, 16 bytes (30h-3Fh) is the BIOS specific configuration data and 64 bytes (40h-7Fh) is the ESCD (Extended System Configuration Data).

<p>
<pre><font size="2">

Offset Offset  Field   Function

Hex     Dec    size

00h      0     1 byte  RTC seconds. Contains the seconds value of current time. <a href="http://bos.asmhackers.net/1/BCD_Format">(BCD Format)</a>

01h      1     1 byte  RTC seconds alarm. Contains the seconds value for the RTC alarm <a href="http://bos.asmhackers.net/1/BCD_Format">(BCD Format)</a>

02h      2     1 byte  RTC minutes. Contains the minutes value of the current time <a href="http://bos.asmhackers.net/1/BCD_Format">(BCD Format)</a>

03h      3     1 byte  RTC minutes alarm. Contains the minutes value for the RTC alarm (<a href="http://bos.asmhackers.net/1/BCD_Format">(BCD Format)</a>

04h      4     1 byte  RTC hours. Contains the hours value of the current time <a href="http://bos.asmhackers.net/1/BCD_Format">(BCD Format)</a>

05h      5     1 byte  RTC hours alarm. Contains the hours value for the RTC alarm <a href="http://bos.asmhackers.net/1/BCD_Format">(BCD Format)</a>

06h      6     1 byte  RTC day of week. Contains the current day of the week (1 .. 7, sunday=1)

07h      7     1 byte  RTC date day. Contains day value of current date <a href="http://bos.asmhackers.net/1/BCD_Format">(BCD Format)</a>

08h      8     1 byte  RTC date month. Contains the month value of current date <a href="http://bos.asmhackers.net/1/BCD_Format">(BCD Format)</a>

09h      9     1 byte  RTC date year. Contains the year value of current date <a href="http://bos.asmhackers.net/1/BCD_Format">(BCD Format)</a>

0Ah     10     1 byte  Status Register A

                       Bit  7   = Update in progress 

                                  (0 = Date and time can be read,

                                   1 = Time update in progress)

                       Bits 6-4 = Time frequency divider (010 = 32.768KHz)

                       Bits 3-0 = Rate selection frequency 

                       (0110 = 1.024KHz square wave frequency)



0Bh     11     1 byte  Status Register B

                       Bit 7 = Clock update cycle 

                               (0 = Update normally, 1 = Abort update in progress)

                       Bit 6 = Periodic interrupt 

                               (0 = Disable interrupt (default), 1 = Enable interrupt)

                       Bit 5 = Alarm interrupt 

                               (0 = Disable interrupt (default), 1 = Enable interrupt)

                       Bit 4 = Update ended interrupt 

                               (0 = Disable interrupt (default), 1 = Enable interrupt)

                       Bit 3 = Status register A square wave frequency 

                               (0 = Disable square wave (default), 1 = Enable square wave)

                       Bit 2 = 24 hour clock 

                               (0 = 24 hour mode (default), 1 = 12 hour mode)

                       Bit 1 = Daylight savings time 

                               (0 = Disable daylight savings (default),

                                1 = Enable daylight savings)



0Ch     12     1 byte  Status Register C - Read only flags indicating system 

                       status conditions

                       Bit  7   = IRQF flag

                       Bit  6   = PF flag

                       Bit  5   = AF flag

                       Bit  4   = UF flag

                       Bits 3-0 = Reserved



0Dh     13     1 byte  Status Register D - Valid CMOS RAM flag on bit 7 

                       (battery condition flag)

                       Bit 7 = Valid CMOS RAM flag 

                       (0 = CMOS battery dead, 1 = CMOS battery power good)

                       Bit 6-0 = Reserved



0Eh     14     1 byte  Diagnostic Status

                       Bit 7 = Real time clock power status 

                       (0 = CMOS has not lost power, 1 = CMOS has lost power)

                       Bit 6 = CMOS checksum status 

                       (0 = Checksum is good, 1 = Checksum is bad)

                       Bit 5 = POST configuration information status 

                       (0 = Configuration information is valid, 

                       1 = Configuration information in invalid)

                       Bit 4 = Memory size compare during POST 

                       (0 = POST memory equals configuration, 

                       1 = POST memory not equal to configuration)

                       Bit 3 = Fixed disk/adapter initialization 

                       (0 = Initialization good, 1 = Initialization bad)

                       Bit 2 = CMOS time status indicator 

                       (0 = Time is valid, 1 = Time is invalid)

                       Bit 1-0 = Reserved



0Fh     15     1 byte  CMOS Shutdown Status

                       00h = Power on or soft reset

                       01h = Memory size pass

                       02h = Memory test pass

                       03h = Memory test fail

                       04h = POST complete; boot system

                       05h = JMP double word pointer with EOI

                       06h = Protected mode tests pass

                       07h = protected mode tests fail

                       08h = Memory size fail

                       09h = Int 15h block move

                       0Ah = JMP double word pointer without EOI

                       0Bh = Used by 80386



10h     16     1 byte  Floppy Disk Drive Types

                       Bits 7-4 = Drive 0 type

                       Bits 3-0 = Drive 1 type

                       0000 = None

                       0001 = 360KB

                       0010 = 1.2MB

                       0011 = 720KB

                       0100 = 1.44MB



11h     17     1 byte  System Configuration Settings

                       Bit 7 = Mouse support disable/enable

                       Bit 6 = Memory test above 1MB disable/enable

                       Bit 5 = Memory test tick sound disable/enable

                       Bit 4 = Memory parity error check disable/enable

                       Bit 3 = Setup utility trigger display disable/enable

                       Bit 2 = Hard disk type 47 RAM area 

                               (0:300h or upper 1KB of DOS area)

                       Bit 1 = Wait for &lt;F1&gt; if any error message disable/enable

                       Bit 0 = System boot up with Numlock (off/on)



12h     18     1 byte  Hard Disk Types

                       Bits 7-4 = Hard disk 0 type

                       Bits 3-0 = Hard disk 1 type

                       0000 = No drive installed

                       0001 = Type 1 installed

                       1110 = Type 14 installed

                       1111 = Type 16-47 (defined later in 19h)



13h     19     1 byte  Typematic Parameters

                       Bit 7 = typematic rate programming disable/enabled

                       Bit 6-5 = typematic rate delay

                       Bit 4-2 = Typematic rate



14h     20     1 byte  Installed Equipment

                       Bits 7-6 = Number of floppy disks 

                       (00 = 1 floppy disk, 01 = 2 floppy disks)

                       Bits 5-4 = Primary display 

                       (00 = Use display adapter BIOS, 01 = CGA 40 column, 

                       10 = CGA 80 column, 11 = Monochrome Display Adapter)

                       Bit 3 = Display adapter installed/not installed

                       Bit 2 = Keyboard installed/not installed

                       Bit 1 = math coprocessor installed/not installed

                       Bit 0 = Always set to 1



15h     21     1 byte  Base Memory Low Order Byte - Least significant byte

16h     22     1 byte  Base Memory High Order Byte - Most significant byte

17h     23     1 byte  Extended Memory Low Order Byte - Least significant byte

18h     24     1 byte  Extended Memory High Order Byte - Most significant byte



19h     25     1 byte  Hard Disk 0 Extended Type - 

                       (10h to 2Eh = Type 16 to 46 respectively)

1Ah     26     1 byte  Hard Disk 1 Extended Type - 

                       (10h to 2Eh = Type 16 to 46 respectively)

1Bh     27     1 byte  User Defined Drive C: 

                       Number of cylinders least significant byte

1Ch     28     1 byte  User Defined Drive C: 

                       Number of cylinders most significant byte

1Dh     29     1 byte  User Defined Drive C: 

                       Number of heads

1Eh     30     1 byte  User Defined Drive C: 

                       Write precomp cylinder least significant byte

1Fh     31     1 byte  User Defined Drive C: 

                       Write precomp cylinder most significant byte

20h     32     1 byte  User Defined Drive C: 

                       Control byte

21h     33     1 byte  User Defined Drive C: 

                       Landing zone least significant byte

22h     34     1 byte  User Defined Drive C: 

                       Landing zone most significant byte

23h     35     1 byte  User Defined Drive C: 

                       Number of sectors



24h     36     1 byte  User Defined Drive D: 

                       Number of cylinders least significant byte

25h     37     1 byte  User defined Drive D: 

                       Number of cylinders most significant byte

26h     38     1 byte  User Defined Drive D: 

                       Number of heads

27h     39     1 byte  User Defined Drive D: 

                       Write precomp cylinder least significant byte

28h     40     1 byte  User Defined Drive D: 

                       Write precomp cylinder most significant byte

29h     41     1 byte  User Defined Drive D: 

                       Control byte

2Ah     42     1 byte  User Defined Drive D: 

                       Landing zone least significant byte

2Bh     43     1 byte  User Defined Drive D: 

                       Landing zone most significant byte

2Ch     44     1 byte  User Defined Drive D: 

                       Number of sectors



2Dh     45     1 byte  System Operational Flags

                       Bit 7 = Weitek processor present/absent

                       Bit 6 = Floppy drive seek at boot enable/disable

                       Bit 5 = System boot sequence

                       Bit 4 = System boot CPU speed high/low

                       Bit 3 = External cache enable/disable

                       Bit 2 = Internal cache enable/disable

                       Bit 1 = Fast gate A20 operation enable/disable

                       Bit 0 = Turbo switch function enable/disable



2Eh     46     1 byte  CMOS Checksum High Order Byte - Most significant byte

2Fh     47     1 byte  CMOS Checksum Low Order Byte - Least significant byte



30h     48     1 byte  Actual Extended Memory Low Order Byte 

                       Least significant byte

31h     49     1 byte  Actual Extended Memory High Order Byte 

                       Most significant byte

32h     50     1 byte  Century Date BCD - Value for century of current date

33h     51     1 byte  POST Information Flags

                       Bit 7 = BIOS length (64KB/128KB)

                       Bit 6-1 = reserved

                       Bit 0 = POST cache test passed/failed



34h     52     1 byte  BIOS and Shadow Option Flags

                       Bit 7 = Boot sector virus protection disabled/enabled

                       Bit 6 = Password checking option disabled/enabled

                       Bit 5 = Adapter ROM shadow C800h (16KB) disabled/enabled

                       Bit 4 = Adapter ROM shadow CC00h (16KB) disabled/enabled

                       Bit 3 = Adapter ROM shadow D000h (16KB) disabled/enabled

                       Bit 2 = Adapter ROM shadow D400h (16KB) disabled/enabled

                       Bit 1 = Adapter ROM shadow D800h (16KB) disabled/enabled

                       Bit 0 = Adapter ROM shadow DC00h (16KB) disabled/enabled



35h     53     1 byte  BIOS and Shadow Option Flags

                       Bit 7 = Adapter ROM shadow E000h (16KB) disabled/enabled

                       Bit 6 = Adapter ROM shadow E400h (16KB) disabled/enabled

                       Bit 5 = Adapter ROM shadow E800h (16KB) disabled/enabled

                       Bit 4 = Adapter ROM shadow EC00h (16KB) disabled/enabled

                       Bit 3 = System ROM shadow F000h (16KB) disabled/enabled

                       Bit 2 = Video ROM shadow C000h (16KB) disabled/enabled

                       Bit 1 = Video ROM shadow C400h (16KB) disabled/enabled

                       Bit 0 = Numeric processor test disabled/enabled



36h     54     1 byte  Chipset Specific Information



37h     55     1 byte  Password Seed and Color Option

                       Bit 7-4 = Password seed (do not change)

                       Bit 3-0 = Setup screen color palette

                           07h = White on black

                           70h = Black on white

                           17h = White on blue

                           20h = Black on green

                           30h = Black on turquoise

                           47h = White on red

                           57h = White on magenta

                           60h = Black on brown



38h-3d  56-61  6 byte  Encrypted Password - (do not change)

3Eh     62     1 byte  Extended CMOS Checksum - Most significant byte

3Fh     63     1 byte  Extended CMOS Checksum - Least significant byte

40h     64     1 byte  Model Number Byte

41h     65     1 byte  1st Serial Number Byte

42h     66     1 byte  2nd Serial Number Byte

43h     67     1 byte  3rd Serial Number Byte

44h     68     1 byte  4th Serial Number Byte

45h     69     1 byte  5th Serial Number Byte

46h     70     1 byte  6th Serial Number Byte

47h     71     1 byte  CRC Byte

48h     72     1 byte  Century Byte

49h     73     1 byte  Date Alarm

4Ah     74     1 byte  Extended Control Register 4A

4Bh     75     1 byte  Extended Control register 4B

4Ch     76     1 byte  Reserved

4Dh     77     1 byte  Reserved

4Eh     78     1 byte  Real Time Clock - Address 2

4Fh     79     1 byte  Real Time Clock - Address 3

50h     80     1 byte  Extended RAM Address - Least significant byte

51h     81     1 byte  Extended RAM Address - Most significant byte

52h     82     1 byte  Reserved

53h     83     1 byte  Extended RAM Data Port

54h     84     1 byte  Reserved

55h     85     1 byte  Reserved

56h     86     1 byte  Reserved

57h     87     1 byte  Reserved

58h     88     1 byte  Reserved

59h     89     1 byte  Reserved

5Ah     90     1 byte  Reserved

5Bh     91     1 byte  Reserved

5Ch     92     1 byte  Reserved

5Dh     93     1 byte  Reserved

</font></pre>

<p>
<i><b>About the author:</b><br>

Pradeep P. Chandiramani<br>

/*PCD*/<br>

<a href="mailto:pradeepchandiramani@yahoo.co.in">pradeepchandiramani@yahoo.co.in</a></i>

<p>
Copyright (C) 2004 by Pradeep P Chandiramani. No part of this article

should be reproduced in any form without prior permission form the 

author. 






<!--Rendering time: 0.015625 -->





<!-- Total Rendering time: 0.03125 -->



<br></font>



<font face="Verdana, Arial, Helvetica, sans-serif" size="1">

<hr>last edited (August 23, 2004) by <a href="http://bos.asmhackers.net/c/authorpage.asp?AuthorID=67959">Doctor Slush</a>, Number of views: 3497, Current Rev: 9 (<A href="http://bos.asmhackers.net/1/CMOS_C&amp;SrcRev=8&amp;DstRev=0&amp;action=diff">Diff</A>)<br></font><br>



<font face="Arial, Helvetica, sans-serif" size=2>
[<a href="http://bos.asmhackers.net/wiki/edit.aspx?WikiID=1&amp;pagename=CMOS_C">Edit this page</a>]&nbsp;
[<a href="http://bos.asmhackers.net/1/CMOS_C&amp;action=history">Page history</a>]&nbsp;
[<a href="http://bos.asmhackers.net/1/special%3aWhatLinksHere&amp;page=CMOS_C">What links here</a>]&nbsp;
[<a href="http://bos.asmhackers.net/1/talk%3aCMOS_C">Discuss this topic</a>]&nbsp;
[<a href="http://bos.asmhackers.net/wiki/printer.aspx?WikiID=1&amp;p=CMOS_C">Printer Friendly</a>]
</font>
 &nbsp;





<!-- Did you know start -->

<br><br>

<table width="333" border="0" cellspacing="0" cellpadding="0" height="10">

<tr>

<td align="left" width="10" valign="top"><img alt="" src="../../../images/corner_1.html" width="10" height="10"></td>

<td valign="top"><img alt="" src="../../../images/line1.html" width="313" height="10"></td>

<td align="right" width="10" valign="top"><img alt="" src="../../../images/corner_2.html" width="10" height="10"></td>

</tr>

</table>

<table width="333" border="0" cellspacing="0" cellpadding="0" bgcolor="#dfdfff">

<tr>

<td bgcolor="#000000" width="1"><img alt="" src="../../../images/spacer.html" width="1" height="6"></td>

<td width="10"><img alt="" src="../../../images/spacer.html" width="10" height="10"></td>

<td><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Did you know that...</b></font><br>

<font face="Verdana, Arial, Helvetica, sans-serif" size="1">

that you can view interesting <a href="http://bos.asmhackers.net/1/special%3aSiteStats">statistics</a> about the CodePedia? 

</font></td>

<td width="10"><img alt="" src="../../../images/spacer.html" width="10" height="10">

</td>

<td bgcolor="#000000" width="1"><img alt="" src="../../../images/spacer.html" width="1" height="6"></td>

</tr>

</table>

<table width="333" border="0" cellspacing="0" cellpadding="0" height="10">

<tr>

<td align="left" width="10" valign="top"><img alt="" src="../../../images/corner_3.html" width="10" height="10"></td>

<td valign="top"><img alt="" src="../../../images/line2.html" width="313" height="10"></td>

<td align="right" width="10" valign="top"><img alt="" src="../../../images/corner_4.html" width="10" height="10"></td>

</tr>

</table>

<br><br>

<!-- Did you know end -->



</td></tr></table>

<table width="780" border="0" cellspacing="0" cellpadding="0" align="center" height="10">

	<tr>

		<td align="left" width="10" valign="top"><img alt="" src="../../../images/corner_1white.html" width="10" height="10"></td>

		<td valign="top"><img alt="" src="../../../images/line1white.html" width="760" height="10"></td>

		<td align="right" width="10" valign="top"><img alt="" src="../../../images/corner_2white.html" width="10" height="10"></td>

	</tr>

</table>

<table width="780" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#000000">

	<tr align="center">

		<td>

			<center>

				<table width="778" border="0" cellspacing="0" cellpadding="0" bgcolor="#ffffff">

					<tr>

						<td width="10"><img alt="" src="../../../images/spacer.html" width="10" height="8"></td>

						<td align="left" width="94"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><a href="http://bos.asmhackers.net/other/newsletterpage.htm">Newsletter</a></b></font></td>

						<td align="left" width="95"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><a href="http://bos.asmhackers.net/other/submission.htm">Submit Content</a></b></font></td>

						<td align="center" width="83"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><a href="http://bos.asmhackers.net/other/about.htm">About</a></b></font></td>

						<td align="center" width="89"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><a href="http://bos.asmhackers.net/other/advertise.htm">Advertising</a></b></font></td>

						<td align="center" width="81"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><a href="http://bos.asmhackers.net/other/awards.htm">Awards</a></b></font></td>

						<td align="right" width="76"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><a href="http://bos.asmhackers.net/other/contact_us.htm">Contact Us</a></b></font></td>

						<td align="right" width="83"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><a href="http://bos.asmhackers.net/other/linktous.htm">Link to us</a> </b></font>

						</td>

						<td align="right" width="115" bgcolor="#ffffff"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>

									<SCRIPT language="JavaScript" type="text/javascript">

<!-- if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) 

{

	var url="http://www.programmersheaven.com/";

	var title="Programmers Heaven";

	document.write('<A HREF="javascript:window.external.AddFavorite(url,title);" TITLE="Add us to Your Favorites!">Add bookmark</A>');

}

									--> </SCRIPT> 

									&nbsp; </b></font>

						</td>

						<td align="center" width="10"><img alt="" src="../../../images/spacer.html" width="10" height="8"></td>

						<td>&nbsp;</td>

					</tr>

				</table>

				<table width="778" border="0" cellspacing="0" cellpadding="0">

					<tr>

						<td width="10" bgcolor="#ffffff"><img alt="" src="../../../images/spacer.html" width="10" height="9"></td>

						<td><img alt="" src="../../../images/line3white.html" width="758" height="9"></td>

						<td width="10" bgcolor="#ffffff"><img alt="" src="../../../images/spacer.html" width="10" height="9"></td>

					</tr>

				</table>

				<table width="778" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#ffffff">

					<tr>

						<td><img alt="" src="../../../images/spacer.html" width="10" height="8"></td>

						<td><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>© 1996-2004 <a href="http://bos.asmhackers.net/other/about.htm" target="_blank">

										128K-Communications Ltd.</a> All rights reserved.</b> Reproduction in 

								whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal 

								action. Please read <b><a href="http://bos.asmhackers.net/other/disclaimer.htm">Terms Of Use</a></b> and<b> <a href="http://bos.asmhackers.net/other/privacy.htm">

										Privacy Statement</a></b> for more information. Development by <a href="http://www.synchrondata.com/" target="_blank">

									<b>Synchron Data</b></a>.</font></td>

						<td valign="top">

							<!-- Begin Ban Man Pro Static Banner Code -->

							<a href="http://209.145.252.12/banmanpro/banman.asp?ZoneID=0&amp;BannerID=1&amp;AdvertiserID=1&amp;CampaignID=1&amp;Task=Click" Target="_blank">

								<img src="../../../images/info.html" alt="Infomagic_logo" border="0" height="30" width="106">

							</a>

							<!-- End Ban Man Pro Static Banner Code -->

						</td>

						<td><img alt="" src="../../../images/spacer.html" width="10" height="8"></td>

					</tr>

				</table>

			</center>

		</td>

	</tr>

</table>

<table width="780" border="0" cellspacing="0" cellpadding="0" align="center" height="10">

	<tr>

		<td align="left" width="10" valign="top"><img alt="" src="../../../images/corner_3white.html" width="10" height="10"></td>

		<td valign="top"><img alt="" src="../../../images/line2white.html" width="760" height="10"></td>

		<td align="right" width="10" valign="top"><img alt="" src="../../../images/corner_4white.html" width="10" height="10"></td>

	</tr>

</table>



</body>
<!-- Mirrored from bos.asmhackers.net/docs/timer/docs/CMOS_C.html by HTTrack Website Copier/3.x [XR&CO'2013], Tue, 07 Oct 2014 11:24:28 GMT -->
</html>





